const router = require('koa-router')();

const {
    fetchSearchData
} = require('../api')

router.get("/data", async (ctx, next) => {
    const gids = ctx.query.gids;
    const keyword = ctx.query.gids;
    const type = ctx.query.gids;
    // console.log(gids,keyword,type);
    try {
        const data = await fetchSearchData(gids, keyword, type)
        ctx.body = data;
    } catch (e) {
        next(e)
    }
})

module.exports = router.routes();